package com.cxsy.lh.controller;

import com.cxsy.lh.entity.EduTeacher;
import com.cxsy.lh.service.EduTeacherService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 讲师管理控制器
 * 
 * @author niuyifan
 * @version 1.0.0
 */
@Tag(name = "edu_teacher", description = "讲师管理")
@RestController
@RequestMapping("/edu/teacher")
public class EduTeacherController {
    
    @Autowired
    private EduTeacherService eduTeacherService;
    
    /**
     * 查询所有讲师
     * 
     * @return 讲师列表
     */
    @Operation(summary = "查询所有讲师")
    @GetMapping
    public List<EduTeacher> getAllTeacher() {
        List<EduTeacher> list = eduTeacherService.list();
        return list;
    }
    @Operation(summary = "逻辑删除讲师")
    @DeleteMapping("/deleteById/{id}")
    public boolean deleteTeacher(@PathVariable("id") String id) {
        return eduTeacherService.removeById(id);
    }
}
